/**
 * C Programming: A Modern Approach
 *
 * version: 2nd
 * author: K.N.King
 * http://knking.com/books/c2
 */

#include <limits.h>
#include <stdio.h>

/**
 *
 */

int main(void) {
    int num = 0;

    printf("Enter a number between 0 and 32767: ");
    scanf("%d", &num);
    if (num > 32767 || num < 0) {
        printf("Error: Invalid number");
        return 0;
    }

    printf("In octal, your number is: %5o\n", num);

    return 0;
}

/*
output:
Enter a number between 0 and 32767: 1953
In octal, your number is:  3641
*/